﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Microsoft.Practices.EnterpriseLibrary.PolicyInjection;

using NCS.IConnect.ApplicationContexts;

using JM.JCY.BusinessFacade;
using JM.JCY.Common;
using JM.JCY.BusinessEntity;
namespace JM.JCY.Proxy
{
    public class NewsProxy : JCYProxyBase<INews>, INews
    {
        private INews GetInstance()
        {
            return PolicyInjection.Create<NewsBF, INews>();
        }

        public NewsDataSet.T_AnnouncementDataTable GetNews(string subject, string category, string status, DateTime? startDate, DateTime? endDate)
        {
            return GetInstance().GetNews(subject, category, status, startDate, endDate);
        }

        public void UpdateNews(NewsDataSet.T_AnnouncementDataTable dt)
        {
            this.GetInstance().UpdateNews(dt);
        }

        public NewsDataSet.T_AnnouncementDataTable GetNewsById(int newsId)
        {
            return GetInstance().GetNewsById(newsId);
        }

        public NewsDataSet.T_NewsDataTable GetNewsForHome(string category, int count)
        {
            return this.GetInstance().GetNewsForHome(category, count);
        }

        public NewsDataSet.T_AnnouncementDataTable GetSpeechForHome(int count)
        {
            return this.GetInstance().GetSpeechForHome(count);
        }

      
    }
}
